/********************************************************************
    copyright (c) by tnmujoy
    @created:	10/20/2011   12:14
    @filename: 	CommondDemo
    @author:	Limiko Lau (limiko.lau@gmail.com)
    @brief:	    
*********************************************************************/

#ifndef DEMO_COMMONDDEMO_H_
#define DEMO_COMMONDDEMO_H_

#include <iostream>
#include "DesignPattern/Commond.hxx"

class Receiver
{
public:
    void open()
    {
        std::cout << "Commond open"<<std::endl;
    }
    void close()
    {
        std::cout << "Commond close"<<std::endl;
    }
protected:
private:
};

class OpenCommond : public tnmujoy::gdut::Commond<Receiver>
{
public:
    virtual void execute()
    {
        receiver_->open();
    }
protected:
private:
};

class CloseCommond : public tnmujoy::gdut::Commond<Receiver>
{
public:
    virtual void execute()
    {
        receiver_->close();
    }
protected:
private:
};
#endif //DEMO_COMMONDDEMO_H_

//
//History:
//[10/20/2011] <limiko.lau@gmail.com> created